package com.dai.spec.gxk.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.dai.spec.common.annotation.Excel;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 学生课程关联对象 t_spec_student_course
 *
 * @author daikl
 * @date 2024-02-29
 */
@TableName("t_spec_student_course")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class StudentCourse implements Serializable {
    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(type = IdType.AUTO)
    @NotNull
    private Long id;

    /**
     * 学生学号
     */
    @Excel(name = "学生学号")
    @NotNull(message = "必须选择学生")
    private Long studentNumber;

    /**
     * 课程id
     */
    @Excel(name = "课程id")
    @NotNull(message = "必须选择课程")
    private Long courseId;

    /**
     * 课程成绩
     */
    @Excel(name = "课程成绩")
    @Range(min = 0, max = 100, message = "分数必须在0-100之间")
    private BigDecimal score;

    /**
     * 选课状态
     * ‘0’ 已选
     * ‘1’ 已退
     */
    @Excel(name = "选课状态")
    @NotNull(message = "课程状态不能为空")
    private String selectStatus;
    /**
     * 选课时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss",timezone = "GMT+8")
    private LocalDateTime selectTime;

    /**
     * 退课时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private LocalDateTime dropTime;
    /**
     * 打分次数
     */
    private Integer markCounts;
}
